package String;

/**
 * String trim()
 * 去除字符串两边的空白字符
 */
public class TrimDemo {
    public static void main(String[] args) {
        String str = "     hello world         ";
        String trim = str.trim(); //trim()后得到新的字符串对象并存储在trim变量中
        System.out.println(trim); //hello world

    }
}










